package com.fdb.efp.nls.service.impl.psd.credit;

import com.fdb.efp.nls.service.facade.NlsPublicService;
import com.fdb.efp.nls.service.facade.NlsQueueSoltComnService;
import com.fdb.efp.nls.service.facade.psd.PreNlsCreditInfoService;
import com.fdb.efp.nls.service.facade.psd.PsdSqsSignatureService;
import com.fdb.efp.nls.service.facade.psd.PsdTaskReqInfoService;
import com.fdb.efp.nls.service.facade.sx.NlsCreditInfoService;
import com.fdb.efp.nls.service.vo.psd.PreNlsCreditInfoVO;
import com.fdb.efp.nls.service.vo.psd.PsdTaskReqInfoVO;
import com.fdb.efp.nls.service.vo.queue.NlsProcessBizVO;
import com.fdb.efp.nls.service.vo.sx.NlsCreditInfoVO;
import com.fdb.basic.framework.core.exception.BizException;
import com.fdb.basic.framework.core.exception.ESBException;
import com.fdb.basic.framework.core.util.DateUtility;
import com.fdb.basic.framework.core.util.RandomCodeUtils;
import com.fdb.efp.nls.service.facade.PtProductUserService;
import com.fdb.efp.nls.service.vo.PtProductUserVO;
import com.fdb.efp.nls.service.facade.CtrLoanContService;
import com.fdb.efp.nls.service.vo.CtrLoanContVO;
import com.fdb.efp.cus.service.facade.CusIndivService;
import com.fdb.efp.cus.service.vo.CusIndivVO;
import com.fdb.efp.nls.service.vo.CfcaSignInfoVO;
import com.fdb.efp.nls.service.facade.CfcaSignInfoService;
import com.fdb.efp.esb.common.constant.EsbBizEnums;
import com.fdb.efp.esb.service.bo.req.frontsystem.MobileBankInfoReqBean;
import com.fdb.efp.esb.service.bo.req.ydxxzf.GeneratorOrderReqBean;
import com.fdb.efp.esb.service.bo.resp.frontsystem.MobileBankInfoRespBean;
import com.fdb.efp.esb.service.bo.resp.ydxxzf.GeneratorOrderRespBean;
import com.fdb.efp.esb.service.facade.EsbInvokeWrapper;
import com.fdb.efp.esb.service.facade.frontsystem.MobileBankInfoService;
import com.fdb.efp.esb.service.facade.ydxxzf.GeneratorOrderService;
import com.fdb.efp.limit.service.facade.LmtPrdContService;
import com.fdb.efp.limit.service.vo.LmtPrdContVO;
import com.fdb.efp.nls.service.impl.sx.CreditSoltServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Objects;
import java.util.Optional;

import static com.fdb.basic.framework.core.constant.BaseConstant.ADMIN;
import static com.fdb.basic.framework.core.constant.BaseConstant.NO_N;
import static com.fdb.efp.nls.common.ConsoleConstant.LIMIT_STS_02;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2019/12/2
 * 功能描述:
 * 修改日期:2019/12/2
 * 修改描述:
 */
@Service("psdAllotTaskHandleService")
public class PsdAllotTaskHandleServiceImpl extends CreditSoltServiceImpl {
    /**
     * 日志信息
     */
    private final Logger logger = LoggerFactory.getLogger(PsdAllotTaskHandleServiceImpl.class);

    @Override
    protected void doExecute(NlsProcessBizVO nlsProcessBizVo, NlsCreditInfoVO nlsCreditInfoVO) throws Exception {
        String applySeq = nlsCreditInfoVO.getLmtApplySeq();
        try {
            logger.info("======>普税贷任务处理服务开始,流水号" + applySeq + "<======");
            PreNlsCreditInfoVO preNlsCreditInfo = new PreNlsCreditInfoVO();
            preNlsCreditInfo.setApplySeq(nlsCreditInfoVO.getPreLmtApplySeq());
            PreNlsCreditInfoVO preNlsCreditInfoVO = preNlsCreditInfoService.queryByPk(preNlsCreditInfo);
            Optional.ofNullable(preNlsCreditInfoVO).orElseThrow(() -> new BizException("任务处理阶段 查询不到预授信申请信息"));

            LmtPrdContVO lmtPrdContVO = new LmtPrdContVO();
            lmtPrdContVO.setLmtApplySeq(nlsCreditInfoVO.getLmtApplySeq());
            lmtPrdContVO = lmtPrdContService.queryByPk(lmtPrdContVO);
            Optional.ofNullable(lmtPrdContVO).orElseThrow(() -> new BizException("任务处理阶段 查询不到授信额度信息"));
            if (preNlsCreditInfoVO != null) {
                GeneratorOrderRespBean generatorOrderRespBean = null;
                String serno = "WX" + DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()) + RandomCodeUtils.generateNumber(4);
                try {
                    generatorOrderRespBean = invokerGeneratorTask(nlsCreditInfoVO, preNlsCreditInfoVO, serno, lmtPrdContVO);
                    if (!EsbBizEnums.RetCodeEnum.SUCCESS.VALUE.equals(generatorOrderRespBean.getRetCd())) {
                        throw new Exception("调用创建工单接口失败");
                    }
                    // 根据经理号取机构号
                    PtProductUserVO ptProduceUser = ptProductUserService.getPtProduceByLoginName(generatorOrderRespBean.getActlHndlrId());
                    Optional.ofNullable(ptProduceUser).orElseThrow(() -> new BizException("任务处理阶段 查询不到客户经理信息"));
                    String userId = generatorOrderRespBean.getActlHndlrId();
                    String orgId = ptProduceUser.getDeptId();
                    if (LIMIT_STS_02.equals(lmtPrdContVO.getLmtStatus())) {
                        // 1. 更新授信信息表的数据 （更新运营人）
                        nlsCreditInfoVO.setNlsOperOrgid(orgId);
                        nlsCreditInfoVO.setNlsOperUserid(userId);
                        nlsCreditInfoVO.setOperateAgencyUser(userId);
                        nlsCreditInfoVO.setOperateAgency(orgId);
                        // 2. 更新额度表的经理信息
                        LmtPrdContVO lmtPrdCont = new LmtPrdContVO();
                        lmtPrdCont.setLmtContNo(lmtPrdContVO.getLmtContNo());
                        lmtPrdCont.setMainBrId(orgId);
                        lmtPrdCont.setChargeoffBrId(orgId);
                        lmtPrdCont.setCusManager(userId);
                        int m = lmtPrdContService.updateByPk(lmtPrdCont);
                        if (m != 1) {
                            logger.info("更新异常，根据授信协议编号" + lmtPrdCont + "更新记录" + m + "条");
                            throw new Exception("更新异常");
                        }
                        // 3. 更新客户信息表的信息
                        CusIndivVO indivVO = new CusIndivVO();
                        indivVO.setCusId(nlsCreditInfoVO.getCusId());
                        indivVO.setCusManager(userId);
                        indivVO.setPerformanceOwner(userId);
                        indivVO.setPerformanceOrg(orgId);
                        int i = cusIndivService.updateByPk(indivVO);
                        if (i != 1) {
                            logger.info("更新异常，根据客户号" + nlsCreditInfoVO.getCusId() + "更新记录" + i + "条");
                            throw new Exception("更新异常");
                        }
                        // 4. 更新签章信息表的信息
                        CfcaSignInfoVO cfcaSignInfoVO = new CfcaSignInfoVO();
                        cfcaSignInfoVO.setApplySeq(applySeq);
                        // 网贷经办机构
                        cfcaSignInfoVO.setNlsOperOrgid(orgId);
                        // 网贷经办人
                        cfcaSignInfoVO.setNlsOperUserid(userId);
                        // 账务机构
                        cfcaSignInfoVO.setFinaBrId(orgId);
                        cfcaSignInfoService.updateByPk(cfcaSignInfoVO);
                        psdSqsSignatureService.updateOperInfo(applySeq, userId, orgId);
                        // 5. 更新合同信息表的信息
                        CtrLoanContVO ctrLoanContVO = new CtrLoanContVO();
                        ctrLoanContVO.setContNo(applySeq);
                        ctrLoanContVO.setPerformanceOwner(userId);
                        ctrLoanContVO.setPerformanceOrg(orgId);
                        ctrLoanContVO.setCusManager(userId);
                        ctrLoanContVO.setInputBrId(orgId);
                        ctrLoanContVO.setMainBrId(orgId);
                        ctrLoanContVO.setFinaBrId(orgId);
                        ctrLoanContVO.setLegalOrgCode(orgId);
                        int n = ctrLoanContService.updateByPk(ctrLoanContVO);
                        if (n != 1) {
                            logger.info("更新异常，根据合同编号" + ctrLoanContVO.getContNo() + "更新记录" + n + "条");
                            throw new Exception("更新异常");
                        }
                        //6. 下发客户经理信息给客户
                        logger.info("分配客户经理完成，开始下发短信，下发场景：{}", "2");
                        sendMsg("2", ptProduceUser, lmtPrdContVO, nlsCreditInfoVO);
                    } else {
                        // 更新授信信息表
                        nlsCreditInfoVO.setOperateAgencyUser(userId);
                        nlsCreditInfoVO.setOperateAgency(orgId);
                        //6. 下发客户经理信息给客户
                        logger.info("分配客户经理完成，开始下发短信，下发场景：{}", "1");
                        sendMsg("1", ptProduceUser, lmtPrdContVO, nlsCreditInfoVO);
                    }
                    int k = nlsCreditInfoService.updateByPk(nlsCreditInfoVO);
                    if (k != 1) {
                        logger.info("更新异常，根据授信流水号" + nlsCreditInfoVO.getLmtApplySeq() + "更新记录" + k + "条");
                        throw new Exception("更新异常");
                    }
                    insertTaskReqInfo(nlsCreditInfoVO, preNlsCreditInfoVO, lmtPrdContVO, generatorOrderRespBean, serno);
                } catch (Exception e) {
                    insertTaskReqInfo1(nlsCreditInfoVO, preNlsCreditInfoVO, lmtPrdContVO, serno);
                    logger.error("普税贷调用任务处理接口失败!!!");
                    e.printStackTrace();
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("工单创建处理异常", e);
        } finally {
            logger.info("======>普税贷任务处理服务结束,流水号" + applySeq + "<======");
        }
    }

    private void insertTaskReqInfo(NlsCreditInfoVO nlsCreditInfoVO, PreNlsCreditInfoVO preNlsCreditInfoVO, LmtPrdContVO lmtPrdContVO, GeneratorOrderRespBean generatorOrderRespBean, String serno) throws BizException {
        PsdTaskReqInfoVO psdTaskReqInfoVO = new PsdTaskReqInfoVO();
        // 授信流水号
        psdTaskReqInfoVO.setLmtApplySeq(nlsCreditInfoVO.getLmtApplySeq());
        psdTaskReqInfoVO.setOrderId(serno);
        if (LIMIT_STS_02.equals(lmtPrdContVO.getLmtStatus())) {
            if (StringUtils.isNotEmpty(nlsCreditInfoVO.getNlsOperUserid())) {
                psdTaskReqInfoVO.setManagerId(nlsCreditInfoVO.getNlsOperUserid());
            } else {
                psdTaskReqInfoVO.setManagerId(preNlsCreditInfoVO.getRecommenderId());
            }
            psdTaskReqInfoVO.setDeptId(nlsCreditInfoVO.getNlsOperOrgid());
            // 额度激活业务
            psdTaskReqInfoVO.setTaskTyp("2");
        } else {
            if (StringUtils.isNotEmpty(nlsCreditInfoVO.getOperateAgencyUser())) {
                psdTaskReqInfoVO.setManagerId(nlsCreditInfoVO.getOperateAgencyUser());
            } else {
                psdTaskReqInfoVO.setManagerId(preNlsCreditInfoVO.getRecommenderId());
            }
            psdTaskReqInfoVO.setDeptId(nlsCreditInfoVO.getOperateAgency());
            // 无卡号  开卡业务
            psdTaskReqInfoVO.setTaskTyp("1");
        }
        // productId为3 广信的普税贷
        psdTaskReqInfoVO.setProductId("3");
        // 状态：1、未处理，2、已分配没处理 3、已处理
        psdTaskReqInfoVO.setHandleStatus("2");
        // 1是个人用户，2是企业用户，3小微企业，4=个体工商户，5=小微企业主
        psdTaskReqInfoVO.setUserType("5");
        psdTaskReqInfoVO.setCusName(nlsCreditInfoVO.getCusName());
        psdTaskReqInfoVO.setGender(nlsCreditInfoVO.getGender());
        psdTaskReqInfoVO.setCelPhone(nlsCreditInfoVO.getIndivMobile());
        psdTaskReqInfoVO.setIdNum(nlsCreditInfoVO.getCertCode());
        psdTaskReqInfoVO.setIdType(nlsCreditInfoVO.getCertType());
        psdTaskReqInfoVO.setCorpName(preNlsCreditInfoVO.getEnterpriseName());
        psdTaskReqInfoVO.setSocialCode(preNlsCreditInfoVO.getSocialCreditCode());
        psdTaskReqInfoVO.setAddress(preNlsCreditInfoVO.getRegistration());
        psdTaskReqInfoVO.setQuota(nlsCreditInfoVO.getApplyAmt());
        psdTaskReqInfoVO.setDueTime(lmtPrdContVO.getExpireDate());
        // 工单生成状态(200表示成功,201表示失败)
        psdTaskReqInfoVO.setCreateStatus(EsbBizEnums.RetCodeEnum.SUCCESS.VALUE.equals(generatorOrderRespBean.getRetCd()) ? 200 : 201);
        psdTaskReqInfoVO.setHandleResult(generatorOrderRespBean.getRetMsg());
        psdTaskReqInfoVO.setCreateMsg(generatorOrderRespBean.getRetMsg());
        psdTaskReqInfoVO.setRemark("普税贷工单创建");
        psdTaskReqInfoVO.setGlobaNo(nlsCreditInfoVO.getGlobalSerno());

        psdTaskReqInfoVO.setCreateDate(DateUtility.getCurrDate());
        psdTaskReqInfoVO.setCreateTime(DateUtility.getCurrTime());
        psdTaskReqInfoVO.setCreateUser(ADMIN);
        psdTaskReqInfoVO.setLastUpdateTime(new Date());
        psdTaskReqInfoVO.setLastUpdateUser(ADMIN);

        psdTaskReqInfoVO.setWarnFlag(NO_N);

        int result = psdTaskReqInfoService.insert(psdTaskReqInfoVO);
        if (result != 1) {
            logger.error("普税贷任务处理阶段插入任务表失败");
            throw new BizException("普税贷任务处理阶段插入任务表失败");
        }
    }

    private GeneratorOrderRespBean invokerGeneratorTask(NlsCreditInfoVO nlsCreditInfoVO, PreNlsCreditInfoVO preNlsCreditInfoVO, String serno, LmtPrdContVO lmtPrdContVO) throws ESBException, InterruptedException {
        GeneratorOrderReqBean generatorOrderReqBean = new GeneratorOrderReqBean();
        //工单id
        generatorOrderReqBean.setWrkOrdrId(serno);
        // 工单状态 1、未处理，2、已分配没处理 3、已处理
        generatorOrderReqBean.setStCd("1");
        // 产品编号 1是快抵e贷 2是支小专项贷款
        generatorOrderReqBean.setPdNo("3");
        // 机构号
        if (LIMIT_STS_02.equals(lmtPrdContVO.getLmtStatus())) {
            generatorOrderReqBean.setBrchId(nlsCreditInfoVO.getNlsOperOrgid());
        } else {
            generatorOrderReqBean.setBrchId(nlsCreditInfoVO.getOperateAgency());
        }
        // 推荐人工号
        generatorOrderReqBean.setCustMgrNo(preNlsCreditInfoVO.getRecommenderId());
        // 客户名称
        generatorOrderReqBean.setCustNm(nlsCreditInfoVO.getCusName());
        // 性别
        generatorOrderReqBean.setGnd(nlsCreditInfoVO.getGender());
        // 手机号码
        generatorOrderReqBean.setMblNo(nlsCreditInfoVO.getIndivMobile());
        // 证件号码
        generatorOrderReqBean.setIdentNo(nlsCreditInfoVO.getCertCode());
        // 证件类型
        generatorOrderReqBean.setIdentTp(nlsCreditInfoVO.getCertType());
        // 企业名称
        generatorOrderReqBean.setEntpNm(preNlsCreditInfoVO.getEnterpriseName());
        // 统一社会信用代码
        generatorOrderReqBean.setUnfdSoclCrdtCd(preNlsCreditInfoVO.getSocialCreditCode());
        // 企业注册地址
        generatorOrderReqBean.setEntpRgstAddr(preNlsCreditInfoVO.getRegistration());
        // 用户标志
        generatorOrderReqBean.setUsrFlg("5");
        // 贷款额度
        generatorOrderReqBean.setLoanLmt(Objects.nonNull(nlsCreditInfoVO.getApproveAmt()) ? nlsCreditInfoVO.getApproveAmt().doubleValue() : BigDecimal.ZERO.doubleValue());
        //贷款期限
        generatorOrderReqBean.setLoanTrm(nlsCreditInfoVO.getApplyTerm());
        //  备注 todo:备注信息需要标明三种状态
        generatorOrderReqBean.setRemark("普税贷工单创建");
        //
        generatorOrderReqBean.setLmtApplySeq(nlsCreditInfoVO.getLmtApplySeq());
        return generatorOrderService.applyGeneratorOrder(generatorOrderReqBean);

    }

    private void insertTaskReqInfo1(NlsCreditInfoVO nlsCreditInfoVO, PreNlsCreditInfoVO preNlsCreditInfoVO, LmtPrdContVO lmtPrdContVO, String serno) {

        if (Objects.nonNull(psdTaskReqInfoService.selectByPrimaryKey(serno))) {
            return;
        }

        PsdTaskReqInfoVO psdTaskReqInfoVO = new PsdTaskReqInfoVO();
        // 授信流水号
        psdTaskReqInfoVO.setLmtApplySeq(nlsCreditInfoVO.getLmtApplySeq());
        psdTaskReqInfoVO.setOrderId(serno);
        if (LIMIT_STS_02.equals(lmtPrdContVO.getLmtStatus())) {
            // 如果为空 则取运行客户经理
            if (StringUtils.isNotEmpty(nlsCreditInfoVO.getNlsOperUserid())) {
                psdTaskReqInfoVO.setManagerId(nlsCreditInfoVO.getNlsOperUserid());
            } else {
                psdTaskReqInfoVO.setManagerId(preNlsCreditInfoVO.getRecommenderId());
            }
            psdTaskReqInfoVO.setDeptId(nlsCreditInfoVO.getNlsOperOrgid());
            // 额度激活业务
            psdTaskReqInfoVO.setTaskTyp("2");
        } else {
            // 如果为空则取预授信的推荐人工号
            if (StringUtils.isNotEmpty(nlsCreditInfoVO.getOperateAgencyUser())) {
                psdTaskReqInfoVO.setManagerId(nlsCreditInfoVO.getOperateAgencyUser());
            } else {
                psdTaskReqInfoVO.setManagerId(preNlsCreditInfoVO.getRecommenderId());
            }
            psdTaskReqInfoVO.setDeptId(nlsCreditInfoVO.getOperateAgency());
            // 无卡号  开卡业务
            psdTaskReqInfoVO.setTaskTyp("1");
        }
        // productId为3 广信的普税贷
        psdTaskReqInfoVO.setProductId("3");
        // 状态：1、未处理，2、已分配没处理 3、已处理
        psdTaskReqInfoVO.setHandleStatus("2");
        // 1是个人用户，2是企业用户，3小微企业，4=个体工商户，5=小微企业主
        psdTaskReqInfoVO.setUserType("5");
        psdTaskReqInfoVO.setCusName(nlsCreditInfoVO.getCusName());
        psdTaskReqInfoVO.setGender(nlsCreditInfoVO.getGender());
        psdTaskReqInfoVO.setCelPhone(nlsCreditInfoVO.getIndivMobile());
        psdTaskReqInfoVO.setIdNum(nlsCreditInfoVO.getCertCode());
        psdTaskReqInfoVO.setIdType(nlsCreditInfoVO.getCertType());
        psdTaskReqInfoVO.setCorpName(preNlsCreditInfoVO.getEnterpriseName());
        psdTaskReqInfoVO.setSocialCode(preNlsCreditInfoVO.getSocialCreditCode());
        psdTaskReqInfoVO.setAddress(preNlsCreditInfoVO.getRegistration());
        psdTaskReqInfoVO.setQuota(nlsCreditInfoVO.getApplyAmt());
        psdTaskReqInfoVO.setDueTime(lmtPrdContVO.getExpireDate());
        // 工单生成状态(200表示成功,201表示失败)
        psdTaskReqInfoVO.setCreateStatus(201);
        psdTaskReqInfoVO.setHandleResult("");
        psdTaskReqInfoVO.setCreateMsg("");
        psdTaskReqInfoVO.setRemark("普税贷工单创建");
        psdTaskReqInfoVO.setGlobaNo(nlsCreditInfoVO.getGlobalSerno());

        psdTaskReqInfoVO.setCreateDate(DateUtility.getCurrDate());
        psdTaskReqInfoVO.setCreateTime(DateUtility.getCurrTime());
        psdTaskReqInfoVO.setCreateUser(ADMIN);
        psdTaskReqInfoVO.setLastUpdateTime(new Date());
        psdTaskReqInfoVO.setLastUpdateUser(ADMIN);
        psdTaskReqInfoVO.setWarnFlag(NO_N);

        psdTaskReqInfoService.insert(psdTaskReqInfoVO);

    }

    /**
     * 下发短信
     *
     * @param stage         下发场景
     * @param ptProduceUser 客户经理信息
     * @param lmtPrdContVO  额度信息
     */
    private  void sendMsg(String stage, PtProductUserVO ptProduceUser, LmtPrdContVO lmtPrdContVO, NlsCreditInfoVO nlsCreditInfoVO) {
        logger.info("增加工单后下发短信处理开始---");
        CusIndivVO cusPkParam = new CusIndivVO();
        cusPkParam.setCusId(nlsCreditInfoVO.getCusId());
        CusIndivVO cusIndivVO = cusIndivService.queryByPk(cusPkParam);
        if (Objects.isNull(cusIndivVO)) {
            logger.error("根据客户号{}获取客户信息失败", cusPkParam.getCusId());
        }
        String phone = cusIndivVO.getPhone();
        if (StringUtils.isBlank(phone)) {
            //下发短信
            logger.info("获取客户手机号为空，无法进行短信下发");
            return;
        }
        if ("1".equals(stage)) {
            //无一类户卡号 也就是新用户
            nlsPublicService.sendMessageWithCusManagerInfo("1", lmtPrdContVO, ptProduceUser, phone);
            return;
        }
        if ("2".equals(stage)) {
            //有一类户卡号，需要判断是否签约手机银
            try {
                boolean b = invokeMobileBankQuery(nlsCreditInfoVO);
                if (b) {
                    nlsPublicService.sendMessageWithCusManagerInfo("3", lmtPrdContVO, ptProduceUser, phone);
                } else {
                    nlsPublicService.sendMessageWithCusManagerInfo("2", lmtPrdContVO, ptProduceUser, phone);
                }
            } catch (Exception e) {
                e.printStackTrace();
                logger.error("查询客户是否签约手机银行异常", e);
            }
        }

    }


    private boolean invokeMobileBankQuery(NlsCreditInfoVO selectCreditInfo) throws Exception {
        MobileBankInfoRespBean resp = null;
        MobileBankInfoReqBean res = new MobileBankInfoReqBean();
        res.setGlobaNo(selectCreditInfo.getGlobalSerno());
        //操作类型身份证
        res.setIdentTp(selectCreditInfo.getCertType());
        // 证件号码
        res.setOprtTp("1");
        //操作渠道代码：网络信贷系统
        res.setOprtChanFlg("07");
        res.setIdentTp(selectCreditInfo.getCertType());
        res.setIdentNo(selectCreditInfo.getCertCode());
        resp = (MobileBankInfoRespBean) new EsbInvokeWrapper(mobileBankInfoService, res, nlsQueueSoltComnService).invoke3Threes();
        if (Objects.isNull(resp)) {
            return false;
        }
        return StringUtils.isNotEmpty(resp.getMblBnkCustNo());
    }

    @Autowired
    @Qualifier("preNlsCreditInfoService")
    private PreNlsCreditInfoService preNlsCreditInfoService;

    @Autowired
    @Qualifier("psdTaskReqInfoService")
    private PsdTaskReqInfoService psdTaskReqInfoService;

    @Autowired
    @Qualifier("lmtPrdContService")
    private LmtPrdContService lmtPrdContService;

    @Autowired
    @Qualifier("generatorOrderService")
    private GeneratorOrderService generatorOrderService;

    @Autowired
    @Qualifier("ptProductUserService")
    private PtProductUserService ptProductUserService;

    @Autowired
    @Qualifier("cusIndivService")
    private CusIndivService cusIndivService;

    @Autowired
    @Qualifier("cfcaSignInfoService")
    private CfcaSignInfoService cfcaSignInfoService;

    @Autowired
    @Qualifier("psdSqsSignatureService")
    private PsdSqsSignatureService psdSqsSignatureService;

    @Autowired
    @Qualifier("ctrLoanContService")
    private CtrLoanContService ctrLoanContService;

    @Autowired
    @Qualifier("nlsCreditInfoService")
    private NlsCreditInfoService nlsCreditInfoService;

    @Autowired
    @Qualifier("nlsPublicService")
    private NlsPublicService nlsPublicService;

    @Autowired
    private MobileBankInfoService mobileBankInfoService;

    @Autowired
    private NlsQueueSoltComnService nlsQueueSoltComnService;
}
